import { registerAppMenu } from '@/app'
import { closeWindow } from '@/common'
import { listSelect } from '@/common/list-select'

function testListSelect() {
  const l: string[] = []
  for (let i = 0; i < 100; i++) {
    l.push('abc-' + i)
  }
  listSelect<string>({
    data: l,
    getItemName: (e) => e,
    title: 'test list select',
    callback: console.log
  })
}

export async function setup() {
  registerAppMenu({
    path: '测试/测试剪贴板',
    onClick() {
      navigator.clipboard.writeText('fuckme')
    }
  })
  registerAppMenu({
    path: '测试/测试关闭页面',
    onClick() {
      closeWindow()
      // navigator.clipboard.writeText('fuckme')
    }
  })
  // registerAppMenu({
  //   path: 'demo/de/adf',
  //   onClick() {
  //     console.log('click')
  //   }
  // })
  // registerAppMenu({
  //   path: 'demo/{mas-icon-add}list-select',
  //   onClick() {
  //     testListSelect()
  //   }
  // })
}
